package se.webbzon.oschi01.nbt;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;

import se.webbzon.oschi01.singleton.Singleton;

public class LongTagFactory extends AbstractTagFactory<Long> implements Singleton {

	private LongTagFactory() {
		super(Tags.TAG_LONG, "TAG_Long");
	}

	@Override public LongTag readTag(String tagName, DataInputStream is) throws IOException {
		return new LongTag(this, tagName, is.readLong());
	}

	@Override public void writeTag(Tag<Long> tag, DataOutputStream dos) throws IOException {
		dos.writeLong(tag.getValue());
	}

	@Override public Tag<Long> createTag(String tagName) {
		return new LongTag(this, tagName, 0);
	}

}
